package com.niodata.dp.task.service.impl;

import com.niodata.dp.task.dao.DynamicExecutionMapper;
import com.niodata.dp.task.entity.DynamicExecution;
import com.niodata.dp.task.service.DynamicExecutionManager;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by admin on 2017/11/15.
 */
@Service("DynamicExecutionManagerImpl")
public class DynamicExecutionManagerImpl implements DynamicExecutionManager {

  @Autowired
  private DynamicExecutionMapper executionMapper;

  public DynamicExecutionManagerImpl() {

  }

  @Override
  public List<DynamicExecution> getUserAuthorizedDynamicExecByDays(long userId, int days,
      int offset, int count, String keyWord, String type) {
    return executionMapper
        .getUserAuthorizedDynamicExecByDays(userId, days, offset, count, keyWord, type);
  }

  @Override
  public List<DynamicExecution> getRunningDynamicExecution() {
    return executionMapper.getRunningDynamicExecution();
  }

  @Override
  public void updateExecStatusAndTime(String id, Date endTime, String status) {
    executionMapper.updateExecStatusAndTime(id, endTime, status);
  }
}
